package com.liugh.controller.zhongche;

import com.baomidou.mybatisplus.plugins.Page;
import com.liugh.config.ResponseModel;
import com.liugh.controller.BaseRestController;
import com.liugh.entity.standard.StandardPage;
import com.liugh.service.zhongche.IStandardPageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Fatao on 2018/10/30 .
 */

@RestController
@Api(description = "标准详情")
@RequestMapping("/standard_page")
public class StandardPageController extends BaseRestController {


    @Autowired
    private IStandardPageService standardPageService;


    /**
     * 获取ItemPage的方法 .
     * @param standItemId .
     * @return .
     */
    @ApiOperation("获取标准图片")
    @GetMapping("/get")
    public ResponseModel<Page<StandardPage>> getItemById(@RequestParam("standItemId") int standItemId,
                                                         @RequestParam(value = "pageNum",defaultValue = "1",required = false)int pageNum,
                                                         @RequestParam(value = "pageSize",defaultValue = "10",required = false)int pageSize) {
        Page<StandardPage> pagePage = new Page<>(pageNum,pageSize);
        pagePage = standardPageService.getItemPageList(pagePage,standItemId);
        return fillSuccessDataPage(pagePage);
    }

}
